import http from '@src/util/http';

const prefix = '/api/application';

/**
 * 获取连接器相关的附件组件的字段
 * @returns Promise
 */
export function connectorAddOnsFieldList(params: {} | undefined): Promise<any> {
  return http.get(`${prefix}/outside/connectorV2/getAdditionalTemplate`, params);
}

/**
 * 保存连接器相关的附件组件的字段
 * @returns Promise
 */
export function connectorSaveAddOnsFieldList(params: {} | undefined): Promise<any> {
  return http.post(`${prefix}/outside/connectorV2/saveAdditional`, params);
}


export function connectorFormSettingInterfaceList(params: {} | undefined): Promise<any> {
  return http.get(`${prefix}/outside/form/getFormControlToOptions`, params);
}


/**
 * 触发器中获取对应接口详情
 * @param params 
 */
export function triggerFormSettingInterfaceList(params: {} | undefined): Promise<any> {
  return http.get(`${prefix}/outside/trigger/getApiFormFieldByApiId`, params);
}

export function getFiledLaForHttp(params = {}) {
  return http.post('/api/application/outside/connectorV2/field/language', params);
}

/**
 * 获取超时提醒的表单时间字段
 */
export function getTimeoutReminderField(params = {}) {
  return http.get(`${prefix}/outside/trigger/getTimeOutFormTimeField`, params);
}
